GBML manual / 3D

view3d_hit_x

The x, in room pixels, where the last view3d_ray met a wall.

Game Boy: not available

Game Boy Color: not available

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

view3d_hit_x() -> real

Returns

real

Description

The x, in room pixels counted from the room's top-left corner, where the last view3d_ray met a wall. It keeps the answer until the next ray.

Example

var d = view3d_ray(view3d_angle());
var wall_x = view3d_hit_x();

Where the wall straight ahead is, left to right.

On the GBA

It keeps the answer of the last view3d_ray until the next one.

See also: Collision in 3Dview3d_rayview3d_hit_y